UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'pj6N8Dc2pPuOIQLhlKgtLZKoW4nJV8jevewZ1P5Vzxo='
WHERE
key_id = '1be339b69bc0e52d8fb07bbec041a3cc5194e80da844520c75d690dafafe2c98'
AND (
token = 'pj6N8Dc2pPuOIQLhlKgtLZKoW4nJV8jevewZ1P5Vzxo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)