UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'H32/l4taom2ish47/d8Ea/LGyGsXvywlHQOiSzB8ikg=' 
WHERE 
  key_id = '17f8ce57ae1407ba183aeb566ca81a55f4f8ea63fea5c82bd4030abe9f8dffe1' 
  AND (
    token = 'H32/l4taom2ish47/d8Ea/LGyGsXvywlHQOiSzB8ikg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024