UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0sNP9j7WoJUR7qG1pV1rB/kWAOkP/ZJzZLFU0hjMk94='
WHERE
key_id = 'a5e0a222efcf190c3d272a3351685dcc9fa9642a6496f5c67f528229d811f4d7'
AND (
token = '0sNP9j7WoJUR7qG1pV1rB/kWAOkP/ZJzZLFU0hjMk94='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)