UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'iFleNAamtTXAqe3FpFVaBgI0i+cvYj7NYY/rYdvwqiQ=' 
WHERE 
  key_id = 'e242a36fe12d09a025eacad34ae932edf04e8b3ea21a1996318471008e68d90e' 
  AND (
    token = 'iFleNAamtTXAqe3FpFVaBgI0i+cvYj7NYY/rYdvwqiQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021