UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'EoWtyXjsAyZHd4MMoPvoDpw7HekOCogt0Ygz7+fMe6g=' 
WHERE 
  key_id = '08a68748cbc98360967493ab607ec20012e287485eb5e14be02e580bcb0d3f3c' 
  AND (
    token = 'EoWtyXjsAyZHd4MMoPvoDpw7HekOCogt0Ygz7+fMe6g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017