UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'HH1xKHBEiujkM4XgSQXhTdb/vCvuDmbgBbBHkZOGAHk=' 
WHERE 
  key_id = '062d6bba2346a64edf2ceddae6ad3f7b4f1f18d0c2e94a345c0019ef69d65daf' 
  AND (
    token = 'HH1xKHBEiujkM4XgSQXhTdb/vCvuDmbgBbBHkZOGAHk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019