UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'cbHtS9QV5PYWckCwimkZGPjbA+kGQFMq0mZ5SAt40pU=' 
WHERE 
  key_id = 'e98f9f06ba476a1012a1db0020d27f312340e60560bddae662827849007666c8' 
  AND (
    token = 'cbHtS9QV5PYWckCwimkZGPjbA+kGQFMq0mZ5SAt40pU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022