UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Wd3/BIE61w46ULhiEjwz1kcC5C2pKB0Hs8QG1z6d7Yk=' 
WHERE 
  key_id = 'e8d2bcc045c593de770922e295c701453d2a4d2f1d017df84a935e559bb62173' 
  AND (
    token = 'Wd3/BIE61w46ULhiEjwz1kcC5C2pKB0Hs8QG1z6d7Yk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030