UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'kv6IJFoORLA7YBJrI+5g4X7QrU5ecmEOe80nFP3lBkE=' 
WHERE 
  key_id = '7950a1ce46bcb75272417544e4aae22752bee108512991e73521f225a70d82d5' 
  AND (
    token = 'kv6IJFoORLA7YBJrI+5g4X7QrU5ecmEOe80nFP3lBkE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047