UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '22YB6Ir1PP6GyqgRw23YErKaOGqwqLAACo66+TrLUfM='
WHERE
key_id = 'cc886ef6c5adbf91cfbb07e7f94dac4f27c36f0aa6d5013545906a8198e023bf'
AND (
token = '22YB6Ir1PP6GyqgRw23YErKaOGqwqLAACo66+TrLUfM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)