UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/XKXpD47tCjBXN8oQhRLviqhH5eRTwt52UjDKlopB60=' 
WHERE 
  key_id = '7070975bb3eef23c795581cf5c188a9b023760e6bd89867b23c72884333cf9d4' 
  AND (
    token = '/XKXpD47tCjBXN8oQhRLviqhH5eRTwt52UjDKlopB60=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020