UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1QtYyjFR8b5CU1lLc9w2palRSVLFywMFPWwbsh6xMnE=' 
WHERE 
  key_id = '2aac748689a0b3c05b1fc0a6f3c1eb595990694008961d68d65f2df25b7cfe64' 
  AND (
    token = '1QtYyjFR8b5CU1lLc9w2palRSVLFywMFPWwbsh6xMnE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00055