UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'OELRJijfDLZ6vCYBbR5GDRJeoE3Tri84f9rumILlFLo='
WHERE
key_id = '237bb6e61b49167869bdfa774508ba34ed415231c2ca4f056d9319ed9ef4c003'
AND (
token = 'OELRJijfDLZ6vCYBbR5GDRJeoE3Tri84f9rumILlFLo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)