UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ffRSKhpzC5MFRwVKNZsRyG3m1/y+lT4vqmcK19CL598=' 
WHERE 
  key_id = 'ee9ca5ceab416b128334bca86115d10efd629e0e3f76d613f6210a94272a47e1' 
  AND (
    token = 'ffRSKhpzC5MFRwVKNZsRyG3m1/y+lT4vqmcK19CL598=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026