UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Xv93ofOE5L39rP6qr/0pfFS7mZyEeuLoBdJqa61Pu2A=' 
WHERE 
  key_id = '33fdf542a58e5f0cdc3cfc1f298d8ea6efbfe699a3976775f0e08dc4b562fd3e' 
  AND (
    token = 'Xv93ofOE5L39rP6qr/0pfFS7mZyEeuLoBdJqa61Pu2A=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021