UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'uepgXDE9+Mr8eRrWmum8XU5kF43GGSOOuPs7d0SJZfA=' 
WHERE 
  key_id = 'da326aaf599626bb80e5e64ff234fd4a2b572e12ea8a8840cdbc9ff41b9425b9' 
  AND (
    token = 'uepgXDE9+Mr8eRrWmum8XU5kF43GGSOOuPs7d0SJZfA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00199