UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FRojmta8li15rWuq9EL0R4Vp0mcZmOHq/wxXDqi1fJI=' 
WHERE 
  key_id = '65510cc2385ef07f3aa164e6c571c9d34fbbcb1e9edfe085ba066de54baa3838' 
  AND (
    token = 'FRojmta8li15rWuq9EL0R4Vp0mcZmOHq/wxXDqi1fJI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017