UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'InCc1HMPzeRPaFPBJvfGvCYYx/ujOcXP70LVbjga3AQ=' 
WHERE 
  key_id = '91515b5e2f913a5fdb5f2dfcecf1e7a5048ef00e431c58021d56f2f4b4baa6de' 
  AND (
    token = 'InCc1HMPzeRPaFPBJvfGvCYYx/ujOcXP70LVbjga3AQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029