UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'h+BIIk7DSn01CfZETPktSycBWJmoeOmQilMHmCI/SNY=' 
WHERE 
  key_id = '26f24e4bfd22b652f351e1c795600f2bf37ad184fd3a7fcfe96f88c99b7292d7' 
  AND (
    token = 'h+BIIk7DSn01CfZETPktSycBWJmoeOmQilMHmCI/SNY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033