UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'tqFcRHvcDZvBsjrRtkF3lqj4VSfRJGL76T0KGe2vB88=' 
WHERE 
  key_id = '7e1ce839918cd42c2b61610455fdde711d25da75f0304e12880d543a51035814' 
  AND (
    token = 'tqFcRHvcDZvBsjrRtkF3lqj4VSfRJGL76T0KGe2vB88=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034