UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6nDEqDmluHC1eKre4Lv/Q1jfMW6EtSK98bHQ+texMmk=' 
WHERE 
  key_id = 'ea8255298f0cd6ce7393113850007d048dbe9c9ab96202d96771d106d3261c75' 
  AND (
    token = '6nDEqDmluHC1eKre4Lv/Q1jfMW6EtSK98bHQ+texMmk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00046