UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'uXirqKoIicCB6bQn5BMb4MCdj7s3duOT9yZ4aw4qZLY='
WHERE
key_id = '8513428183e24ef52077bd6fad3449374faf9cea9d3ab5e07d9b7720f65f572c'
AND (
token = 'uXirqKoIicCB6bQn5BMb4MCdj7s3duOT9yZ4aw4qZLY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)