UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'SG0p3hI8ZSY+k2N4w28ChQyMai5i2FZ5xwenJ5iuLuY=' 
WHERE 
  key_id = '36b61d9c69280de114dde09ca1dd3e6d45fcd1d4140b60bc4da873d898943d9f' 
  AND (
    token = 'SG0p3hI8ZSY+k2N4w28ChQyMai5i2FZ5xwenJ5iuLuY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023