UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'EFdKKbiyxfVrn7wmIvzwVUgdc92gCtVGVOQMQ9yYnXE='
WHERE
key_id = 'bd4147c5448f0b3cacd6aeaef8be4a9f0faec62d8b9cf53f41c7de4f9ddb488c'
AND (
token = 'EFdKKbiyxfVrn7wmIvzwVUgdc92gCtVGVOQMQ9yYnXE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)