UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'RM7QOxYKd5AA8FH5SHjHJ3bm29JC0ao52AYgqTP3R+I=' 
WHERE 
  key_id = '93ae10e9175e34199ba229ee709068d14b43e83b9ceb1dc92845ebc16d675b75' 
  AND (
    token = 'RM7QOxYKd5AA8FH5SHjHJ3bm29JC0ao52AYgqTP3R+I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027