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