UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'oi/HfbJ3EH/Og/J1oZb8TgUa/zeoRq8pHHtaD89P2Ig=' 
WHERE 
  key_id = '27a61953f0dc713f9f6323ca902124fd8ad8c30c0b42d4911439c4afeba31967' 
  AND (
    token = 'oi/HfbJ3EH/Og/J1oZb8TgUa/zeoRq8pHHtaD89P2Ig=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021