UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'MI6oPqgnuyEU5ncm5SU22GGyfzb4ckTwrHyAj4gmiuA=' 
WHERE 
  key_id = '808e1e47aaa17fdd024f4bb8d7e2351ff70f265c7c16e93cb574e67ab79ff1a4' 
  AND (
    token = 'MI6oPqgnuyEU5ncm5SU22GGyfzb4ckTwrHyAj4gmiuA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036