UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'qDFaHulqZ1MrDbPXBwoqkcUjHIqrUgpPz0ObQ00XxSU=' 
WHERE 
  key_id = 'ce314bd86df7bbca9cdbf7067f11f8daa7bf1fc26adced8730293a8c53e536d4' 
  AND (
    token = 'qDFaHulqZ1MrDbPXBwoqkcUjHIqrUgpPz0ObQ00XxSU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032