UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8my5rHpRZQAyHEMQzlb1DNViUqxGjrXb/M35h0HebOI='
WHERE
key_id = '808cb3904c2c590a2ba96272fbefb4db880bde05f12634ba6ee27afca3812c0d'
AND (
token = '8my5rHpRZQAyHEMQzlb1DNViUqxGjrXb/M35h0HebOI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)