UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'fSha9utUev/Z0dSmDXfkJinNwHhHMFh1rdW8PHJ3z6M=' 
WHERE 
  key_id = '46648d118d471da96b0361a56f3e7131d5ae88a9ca0a84dd9df583180e5d75b3' 
  AND (
    token = 'fSha9utUev/Z0dSmDXfkJinNwHhHMFh1rdW8PHJ3z6M=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031