UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'S4J48oEA6t/Ei1kRRwPB6xQFIyCC8aMZ3rRnxAkmrMg=' 
WHERE 
  key_id = 'fe44b01eb8c072ee553cbc77c7967f87ade12cfcdc537740e03b749ec253121c' 
  AND (
    token = 'S4J48oEA6t/Ei1kRRwPB6xQFIyCC8aMZ3rRnxAkmrMg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027