UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jkTSKSLCa4QcufTjfBZ6+vH7kWCO73IcJpWGmzBOqOs=' 
WHERE 
  key_id = '50ab4a177063273a1de55450a1983dc41a243942d1ab71be06c5220182c07bee' 
  AND (
    token = 'jkTSKSLCa4QcufTjfBZ6+vH7kWCO73IcJpWGmzBOqOs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033