UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'pT4ge4loMo8ylNXc2CJnAtI4ZEsb/d2HjTo7fNCJ+eg='
WHERE
key_id = 'd66f4de5bec5a98af9feb8a3f1fbad75292b1314e66ad1382ea34c293c4f64b4'
AND (
token = 'pT4ge4loMo8ylNXc2CJnAtI4ZEsb/d2HjTo7fNCJ+eg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)