UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9M71FCmBgyyWZcnLoQvAZwlrlwZnidvJMImfTLA+5d4=' 
WHERE 
  key_id = '0a66c3b9280a1847151e92f6e5e3b22ffb15a6adafb1c88953ddc428634af133' 
  AND (
    token = '9M71FCmBgyyWZcnLoQvAZwlrlwZnidvJMImfTLA+5d4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022